<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<h2>
    ${empty term.id?"添加标签":"修改标签"}
</h2>
<form id="term-form"  class=" form-horizontal " role="form" style="padding-left: 20px">
        <input type="hidden" id="id" name="id" value="${term.id}">

        <div class="form-group">
            <label for="name" class=" col-sm-2 control-label"> 标签名称：</label>
            <div class="col-sm-4">
                <input type="text" class="form-control input-sm " id="name" name="name" value="${term.name}" >
            </div>
        </div>
        <div class="form-group">
            <label for="type" class="col-sm-2 control-label"> 标签类型：</label>
            <div class="col-sm-3">
                <input type="text" class="form-control input-sm " id="type" name="type" value="${term.type}" >
            </div>
        </div>


        <div class="form-group">
            <label for="slug" class="col-sm-2 control-label" > 标签描述：</label>
            <div class="col-sm-8">
                <textarea id="slug" class="form-control" name="slug" >${term.slug}</textarea>
            </div>
        </div>

        <div  style="clear: both">
            <shiro:hasPermission name="sys:menu:edit">
                <button id="term-submit" class="btn btn-primary btn-sm" type="button">保 存</button>
            </shiro:hasPermission>
            <button id="term-cancel" class="btn btn-sm" type="button" onclick="history.go(-1)">返 回</button>
        </div>
</form>
<script>
    <c:if test="${env == 'pro' }">
    requirejs(['${ctx}/assets/js/app/admin/term-form-page.js']);
    </c:if>
    <c:if test="${env != 'pro' }">
    requirejs(['${ctx}/assets/js/app/admin/term-form-page.js']);
    </c:if>

</script>
